-
Notifications
You must be signed in to change notification settings - Fork 592
[WIP] PHP 8.5 release page #1454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
🚀 Regression report for commit 95c7f62 is at https://web-php-regression-report-pr-1454.preview.thephp.foundation |
🚀 Preview for commit 95c7f62 can be found at https://web-php-pr-1454.preview.thephp.foundation |
Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
$upcomingRelease = null; | ||
foreach ($php as $key => $version) { | ||
if ($version['state'] === 'upcoming') { | ||
$upcomingRelease = $version; | ||
break; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a good example, because this could just be array_find()
.
$upcomingRelease = array_first( | ||
array_filter( | ||
$php, | ||
static fn($version) => $version['state'] === 'upcoming' | ||
) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
<div class="php8-compare__main"> | ||
<div class="php8-compare__block example-contents"> | ||
<div class="php8-compare__label">PHP < 8.5</div> | ||
<div class="php8-code phpcode"> | ||
<?php highlight_php_trimmed( | ||
<<<'PHP' | ||
$sh = curl_share_init(); | ||
curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS); | ||
curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT); | ||
|
||
$ch1 = curl_init('https://php.net/'); | ||
curl_setopt($ch1, CURLOPT_SHARE, $sh); | ||
curl_exec($ch1); | ||
|
||
$ch2 = curl_init('https://thephp.foundation/'); | ||
curl_setopt($ch2, CURLOPT_SHARE, $sh); | ||
curl_exec($ch2); | ||
|
||
curl_share_close($sh); | ||
|
||
curl_close($ch1); | ||
curl_close($ch2); | ||
PHP | ||
|
||
); ?> | ||
</div> | ||
</div> | ||
<div class="php8-compare__arrow"></div> | ||
<div class="php8-compare__block example-contents" style="display: table;"> | ||
<div class="php8-compare__label php8-compare__label_new">PHP 8.5</div> | ||
<div class="php8-code phpcode" style="display: table-cell;"> | ||
<?php highlight_php_trimmed( | ||
<<<'PHP' | ||
$sh = curl_share_init_persistent([ | ||
CURL_LOCK_DATA_DNS, | ||
CURL_LOCK_DATA_CONNECT | ||
]); | ||
|
||
$ch1 = curl_init('https://php.net/'); | ||
curl_setopt($ch1, CURLOPT_SHARE, $sh); | ||
curl_exec($ch1); | ||
|
||
$ch2 = curl_init('https://thephp.foundation/'); | ||
curl_setopt($ch2, CURLOPT_SHARE, $sh); | ||
curl_exec($ch2); | ||
|
||
curl_close($ch1); | ||
curl_close($ch2); | ||
PHP | ||
); ?> | ||
</div> | ||
</div> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comparison is not really meaningful to understand what has changed. At least some explanation is necessary. curl_close()
should be removed in all cases, since it is useless with 8.0 and deprecated with 8.5.
#[DataProvider('subtractionProvider')] | ||
public function testSubtraction( | ||
int $minuend, | ||
int $subtrahend, | ||
int $result | ||
): void | ||
{ | ||
$this->assertSame( | ||
$result, | ||
Calculator::subtract($minuend, $subtrahend) | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be kept in sync with the 8.5 version. Unfortunately the 8.5 version can't yet use PHPUnit, since sebastianbergmann/phpunit#6136 is not implemented yet. So both should use some “generic test framework”.
Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
<div class="php8-code phpcode"> | ||
<?php highlight_php_trimmed( | ||
<<<'PHP' | ||
$components = parse_url("https://php.net/releases/8.5/en.php"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$components = parse_url("https://php.net/releases/8.5/en.php"); | |
$components = parse_url('https://php.net/releases/8.5/en.php'); |
To match the coding style in the other samples, single quotes would be preferable.
<<<'PHP' | ||
use Uri\Rfc3986\Uri; | ||
|
||
$uri = new Uri("https://php.net/releases/8.5/en.php"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$uri = new Uri("https://php.net/releases/8.5/en.php"); | |
$uri = new Uri('https://php.net/releases/8.5/en.php'); |
Preview: https://web-php-pr-1454.preview.thephp.foundation/releases/8.5/en.php